<?php require '../includes/security.php'; ?>

<?php require_once('../Connections/connection.php'); ?>
<?php


$id_galleria = $_GET['id_galleria'];


mysql_select_db($database_setroma, $setroma);
$query_oggetti = "SELECT * FROM Immagini where id_galleria=".$id_galleria;
$oggetti = mysql_query($query_oggetti, $setroma) or die(mysql_error());
$row = mysql_fetch_assoc($oggetti);
$totalRows = mysql_num_rows($oggetti);
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Elenco Immagini</title>
<head>
<script type="text/javascript" src="../jquery.js"></script>
<script type="text/javascript" src="../thickbox.js"></script>
<script type="text/javascript" src="../scripts/BubbleTooltips.js"></script>
<link rel='stylesheet' type='text/css' href='../styles/style.css' />
<link rel='stylesheet' type='text/css' href='../thickbox.css' />

<?php include '../includes/jsscripts.php'; ?>

</head>


<body>
<h1>SiteRoom - Amministrazione </h1>
<br>
<table  class="sofT">
<tr>
	<td colspan="4" class="helpHed">Elenco Immagini</td>
	<td class="helpHed"><a href="inserisci_immagine.php?id_galleria=<?php echo $id_galleria; ?>">Nuova Immagine</a></td>
</tr>
  <tr>
    <td class="helpHed">ID</td>
    <td class="helpHed">Titolo</td>
    <td class="helpHed">Immagine</td>
	<td class="helpHed"></td>
	<td class="helpHed"></td>

  </tr>
  <?php do { ?>
    <tr>
      <td><?php echo $row['id_immagine']; ?></td>
      <td><?php echo $row['Titolo']; ?></td>
      <td><a href="<?php echo $row['Path']; ?>" class="thickbox"><img src="../userfiles/galleries/<?php echo $row['Path']; ?>" height=50px /></a></td>
	  <td><a href="modifica_immagine.php?id=<?php echo $row['id_immagine']; ?>">Modifica</a></td>
	  <td><a href="elimina_immagine.php?id=<?php echo $row['id_immagine']; ?>&id_galleria=<?php echo $id_galleria; ?>" onclick="return confirm('Sei sicuro di vole cancellare l\'immagine?\nUna volta rimossa non sara\' possibile recuperarla!')">Elimina</a></td>
    </tr>
    <?php } while ($row = mysql_fetch_assoc($oggetti)); ?>
</table>
<?php include '../includes/admin_footer.php'; ?>
</body>
</html>
<?php
mysql_free_result($oggetti);
?>
